import axios from '@/api/fetch';
import SERVER from '@/api/server';
// 查询材料收支汇总横向报表
export const materialInfo = params =>
  axios.get(`${SERVER.SEARCH_DMSCLOUD_PART}/material/query`, {
    params
  });
// 查询材料收支汇总纵向报表
export const materialqueryzInfo = params =>
  axios.get(`${SERVER.DMSCLOUD_PART}/material/queryz`, {
    params
  });
// 查询材料收支汇总纵向报表表头
export const titleHead = params =>
  axios.get(`${SERVER.SEARCH_DMSCLOUD_PART}/material/queryTitle`, {
    params
  });

// 材料收支汇总查询导出
// export const getExcelList = (params = {}) => {
//   // for (const key in params) {
//   //   if (!params[key]) {
//   //     params[key] = '';
//   //   }
//   // }
//   const url = `${SERVER.DMSCLOUD_PART}/material/export`;
//   return axios({
//     url,
//     method: 'get',
//     responseType: 'blob',
//     data: params
//   });
// };
export const getExcelList = params =>
  axios.get(`${SERVER.SEARCH_DMSCLOUD_PART}/material/export`, {
    params,
    responseType: 'blob'
  });

// 查询导出数据
export const exportQueryz = params =>
  axios.get(`${SERVER.SEARCH_DMSCLOUD_PART}/material/queryz/export`, {
    params,
    responseType: 'arraybuffer'
  });
